/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package javaboken.tjugoett;
import static javax.swing.JOptionPane.*;
/**
 *
 * @author Mikael K
 */
public class Human extends Player{
    //Human är en Player vilken spelar på ett visst sätt
    public Human(Stack t){
        super(t);
    }

    public void play(){
        newGame();
            while(p < 21){
                newCard();
                if(p < 21){
                    int answer = showConfirmDialog(null, "You've got these cards:" + symbols + " and " + p + " points." + "\nWould you like another card?");
                        if(answer == 1){ //no
                            break;
                        }
                        else if(answer == 2){ // cancel
                            System.exit(0);
                        }
                }
                else{
                    showMessageDialog(null, "You've got these cards: " + symbols + " and " + p + " points.");
                }
            }
    }
}
